
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/site.master" AutoEventWireup="true"  CodeFile="Klijent.aspx.cs" Inherits="Klijent" Title="Klijent List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Klijent List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" Visible="true" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
			AutoGenerateColumns="False"					
			OnSelectedIndexChanged="GridView_SelectedIndexChanged"
			DataSourceID="KlijentDataSource"
			DataKeyNames="Id"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Klijent.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="ImeKlijenta" HeaderText="Ime Klijenta" SortExpression="ImeKlijenta"  />
				<asp:BoundField DataField="Mb" HeaderText="Mb" SortExpression="MB"  />
				<asp:BoundField DataField="Adresa" HeaderText="Adresa" SortExpression="Adresa"  />
				<asp:TemplateField HeaderText="Id Mjesto">
				<ItemTemplate>
						<asp:Repeater ID="Id1" runat="server" DataSourceID="MjestoFilter1">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="MjestoFilter1" runat="server"
							DataSourceID="MjestoDataSource1"
							Filter='<%# String.Format("Id = {0}", Eval("IdMjesto")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


				<asp:BoundField DataField="Telefon" HeaderText="Telefon" SortExpression="Telefon"  />
				<asp:BoundField DataField="Telefon2" HeaderText="Telefon2" SortExpression="Telefon2"  />
				<asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax"  />
				<asp:BoundField DataField="Fax2" HeaderText="Fax2" SortExpression="Fax2"  />
				<asp:BoundField DataField="WebAdresa" HeaderText="Web Adresa" SortExpression="WebAdresa"  />
				<asp:BoundField DataField="ZiroRacun" HeaderText="Ziro Racun" SortExpression="ZiroRacun"  />
				<asp:BoundField DataField="ZiroRacun2" HeaderText="Ziro Racun2" SortExpression="ZiroRacun2"  />
				<asp:BoundField DataField="ZiroRacun3" HeaderText="Ziro Racun3" SortExpression="ZiroRacun3"  />
				<asp:BoundField DataField="Napomena1" HeaderText="Napomena1" SortExpression="Napomena1"  />
				<asp:BoundField DataField="Napomena2" HeaderText="Napomena2" SortExpression="Napomena2"  />
				<asp:TemplateField HeaderText="Id Tip">
				<ItemTemplate>
						<asp:Repeater ID="Id2" runat="server" DataSourceID="KlijentTipFilter2">
							<ItemTemplate>
								<%# Eval("Naziv") %>
							</ItemTemplate>
						</asp:Repeater>

						<data:EntityDataSourceFilter ID="KlijentTipFilter2" runat="server"
							DataSourceID="KlijentTipDataSource2"
							Filter='<%# String.Format("Id = {0}", Eval("IdTip")) %>'
						/>
					</ItemTemplate>
				</asp:TemplateField>


			</Columns>
			<EmptyDataTemplate>
				<b>No Klijent Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnKlijent" OnClientClick="javascript:location.href='/NetROS.Tiers.website/admin/KlijentEdit.aspx'; return false;" Text="Add New"></asp:Button>
			
		<data:MjestoDataSource ID="MjestoDataSource1" runat="server"
			SelectMethod="GetAll"
		/>

		<data:KlijentTipDataSource ID="KlijentTipDataSource2" runat="server"
			SelectMethod="GetAll"
		/>

		<data:KlijentDataSource ID="KlijentDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
		>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:KlijentDataSource>
	    		
</asp:Content>



